#include <iostream>
#include <string>
#define LL long long
using namespace std;

const int kMaxN = 3e5 + 10;
const LL kInf = 1e18;

LL dp[kMaxN][2];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int X, Y, Z;
  string s;

  cin >> X >> Y >> Z >> s;
  dp[0][0] = 0;
  dp[0][1] = Z;

  for (int i = 0; i < s.size(); i++) {
    dp[i + 1][0] = dp[i + 1][1] = kInf;
    dp[i][0] = min(dp[i][0], dp[i][1] + Z);
    dp[i][1] = min(dp[i][1], dp[i][0] + Z);
    dp[i + 1][0] = min(dp[i + 1][0], dp[i][0] + (s[i] == 'a' ? X : Y));
    dp[i + 1][1] = min(dp[i + 1][1], dp[i][1] + (s[i] == 'A' ? X : Y));
  }
  cout << min(dp[s.size()][0], dp[s.size()][1]) << "\n";
  return 0;
}